package com.chunxuan.langquan.ui.activity;

import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.TextView;

import androidx.appcompat.app.AppCompatActivity;

import com.chunxuan.langquan.MainActivity;
import com.chunxuan.langquan.R;

/**
 * 有4个按钮的导航页
 */
public class GuidActivity extends AppCompatActivity implements View.OnClickListener {
//    private Button btnCourse,btnZhibo,btnMall,btnMine;
    private TextView tvCourse,tvZhibo,tvMall,tvMine;
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        // requestWindowFeature(Window.FEATURE_NO_TITLE);
        setContentView(R.layout.activity_guid1);
        tvCourse=findViewById(R.id.tv_course);
        tvZhibo=findViewById(R.id.tv_zhibo);
        tvMall=findViewById(R.id.tv_mall);
        tvMine=findViewById(R.id.tv_mine);
        tvCourse.setOnClickListener(this);
        tvZhibo.setOnClickListener(this);
        tvMall.setOnClickListener(this);
        tvMine.setOnClickListener(this);
    }

    @Override
    public void onClick(View view) {
        Intent intent=new Intent(GuidActivity.this, MainActivity.class);
        switch (view.getId()){
            case R.id.tv_course:
                intent.putExtra("guid_id",0);
                startActivity(intent);
                break;
            case R.id.tv_zhibo:
                intent.putExtra("guid_id",1);
                startActivity(intent);
                break;
            case R.id.tv_mall:
                intent.putExtra("guid_id",2);
                startActivity(intent);
                break;
            case R.id.tv_mine:
                intent.putExtra("guid_id",3);
                startActivity(intent);
                break;
        }
    }
}